package cn.glutnn.service.impl;

import cn.glutnn.entity.Purchase;
import cn.glutnn.entity.Result;
import cn.glutnn.mapper.SellPurchaseMapper;
import cn.glutnn.service.SellPurchaseService;
import cn.glutnn.utils.ThreadLocalUtil;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.stereotype.Service;
import cn.glutnn.entity.SellPurchase;

import java.util.List;
import java.util.Map;

/**
 * (SellPurchase)表服务实现类
 *
 * @author msh
 * @since 2024-10-25 09:49:09
 */
@Service
public class SellPurchaseServiceImpl extends ServiceImpl<SellPurchaseMapper, SellPurchase> implements SellPurchaseService {

    @Override
    public Result<List<SellPurchase>> selectByName() {
        Map o = ThreadLocalUtil.get();
        List<SellPurchase> list = list(new QueryWrapper<SellPurchase>().eq("own_name", o.get("username")));
        return Result.success(list);
    }
}

